Filter hook 'current_theme_supports-{$feature}'

in WP Core File wp-includes/theme.php at line 3220

View Source

current_theme_supports-{$feature}

Filter Hook
Description
Filters whether the active theme supports a specific feature. The dynamic portion of the hook name, `$feature`, refers to the specific theme feature. See add_theme_support() for the list of possible values.

Hook Information

File Location wp-includes/theme.php View on GitHub
Hook Type Filter
Line Number 3220

Hook Parameters

Type Name Description
bool $supports Whether the active theme supports the given feature. Default true.
array $args Array of arguments for the feature.
string $feature The theme feature.

Usage Examples

Basic Usage
<?php
// Hook into current_theme_supports-{$feature}
add_filter('current_theme_supports-{$feature}', 'my_custom_filter', 10, 3);

function my_custom_filter($supports, $args, $feature) {
    // Your custom filtering logic here
    return $supports;
}

Source Code Context

wp-includes/theme.php:3220 - How this hook is used in WordPress core
<?php
3215  	 *
3216  	 * @param bool   $supports Whether the active theme supports the given feature. Default true.
3217  	 * @param array  $args     Array of arguments for the feature.
3218  	 * @param string $feature  The theme feature.
3219  	 */
3220  	return apply_filters( "current_theme_supports-{$feature}", true, $args, $_wp_theme_features[ $feature ] ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
3221  }
3222  
3223  /**
3224   * Checks a theme's support for a given feature before loading the functions which implement it.
3225   *

PHP Documentation

<?php
/**
	 * Filters whether the active theme supports a specific feature.
	 *
	 * The dynamic portion of the hook name, `$feature`, refers to the specific
	 * theme feature. See add_theme_support() for the list of possible values.
	 *
	 * @since 3.4.0
	 *
	 * @param bool   $supports Whether the active theme supports the given feature. Default true.
	 * @param array  $args     Array of arguments for the feature.
	 * @param string $feature  The theme feature.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 3
  • File: wp-includes/theme.php
Related Hooks

Related hooks will be displayed here in future updates.